package br.com.dubs.persistence.entities.comparators;

import java.io.Serializable;
import java.util.Comparator;

import br.com.dubs.persistence.entities.MsgEntity;

public class MsgEntityComparator implements Comparator<MsgEntity>, Serializable {

	public int compare(MsgEntity o1, MsgEntity o2) {
		if (o1.getDate().after(o2.getDate())) {
			return 1;
		} else if (o1.getDate().before(o2.getDate())) {
			return -1;
		} else if (o1.equals(o2)) {
			return 0;
		}
		return 0;
	}

}
